package com.moli.iov.notify.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.moli.iov.notify.mapper.SmsMapper;
import com.moli.iov.notify.model.dto.SmsDto;
import com.moli.iov.notify.model.po.Sms;
import com.moli.iov.notify.service.ISmsService;
import org.springframework.stereotype.Service;

/**
 * <p>
 *
 * </p>
 *
 * @author zql
 * @since 2019/9/10 19:24
 */
@Service
public class SmsServiceImpl extends ServiceImpl<SmsMapper, Sms> implements
    ISmsService {

  /**
   * 保存短信
   * @param smsDto
   * @param status
   * @return
   */
  @Override
  public boolean saveNotifySms(SmsDto smsDto, int status) {
    Sms notifySms = new Sms();

    notifySms.setMobile(smsDto.getMobile());
    notifySms.setContent(smsDto.getJsonData());
    notifySms.setTempleteCode(smsDto.getTempleteCode());
    notifySms.setStatus(status);

    return super.save(notifySms);
  }
}
